package com.outlandr.irc.client.replies;

public class RplFactory {

	
	
	
	
	
	public static RplServerReply getReply(String reply) {
		String[] parts = reply.split(" :");
		String[] temp = parts[0].split(" ");
		int replyNum;
		if (temp.length > 1 && temp[1].matches("\\d\\d\\d")) {
			replyNum = Integer.parseInt(temp[1]);
		
			switch (replyNum) {
				case 001:
					return new RplWelcome();
				case 002:
				case 003:
				case 004:
				case 005:
					break;
				case 251:
				case 252:
				case 254:
				case 255:
				case 265:
				case 266:
					break;
				case RplServerReply.RPL_TOPIC: 
					return new RplTopic(parts[0], parts[1]);
				case RplServerReply.RPL_NAMREPLY:
					return new RplNamReply(parts[0], parts[1]);
				case 375:
				case 376:
				case 372:
					break;
				case 433:
				default:
					break;
				
			}
		}
		return null; 
	}
}
